﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ReactiveChannelMessaging.WinForms
{
    /// <summary>
    /// 用于跟踪待处理请求的类
    /// </summary>
    public class PendingRequest
    {
        public Guid RequestId { get; }
        public byte[] RequestData { get; }
        public DateTime SendTime { get; }
        public TaskCompletionSource<byte[]> ResponseTcs { get; }
        public string Description { get; }

        public PendingRequest(Guid requestId, byte[] requestData, string description)
        {
            RequestId = requestId;
            RequestData = requestData;
            SendTime = DateTime.Now;
            ResponseTcs = new TaskCompletionSource<byte[]>();
            Description = description;
        }
    }

}
